package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/sayhi")
    public String sayHi(){
        System.out.println("sayhi方法被执行了");
        return "你好，世界";
    }

    @RequestMapping("/sayhello")
    public String sayHello(){
        try {
            Thread.sleep(200);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("sayhello方法被执行了");
//        int num = 10 / 0;
        return "世界，你好";
    }
}
